package airlinesystem;

import java.util.HashSet;
import java.util.Set;

/**
 * Represents a person in this Airline System
 * @author Robert Maaskant & Dennis van der Zwet
 *
 */
public class Person
{
  /**
   * The person's name
   */
  private String name;
  /**
   * The roles of this person.
   */
  private Set<PersonRole> roles;
  /**
   * The airline this person is associated with
   */
  private Airline airline;
  
  /**
   * Constructor for Person
   * @param name the name of this person
   */
  public Person(String name)
  {
    this.name = name;
    this.roles = new HashSet<PersonRole>();
  }

  /**
   * Returns the name of this person
   * @return the name of this person
   */
  public String getName()
  {
    return name;
  }

  /**
   * Returns the set of roles this person has
   * @return the set of roles this person has
   */
  public Set<PersonRole> getRoles()
  {
    return new HashSet<PersonRole>(roles); 
  }

  /**
   * Adds a role to this person's set of roles
   * @param r the role to add to this person's set of roles
   */
  public void addRole(PersonRole r)
  {
    roles.add(r);
  }

}
